package com.qjdchina.sku.front.web.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qjdchina.common.web.util.RestBody;
import com.qjdchina.commons.result.Result;
import com.qjdchina.sku.biz.EstateTypeManager;
import com.qjdchina.sku.model.EstateType;
import com.qjdchina.sku.service.enums.SkuResultCode;

/**
 * 物业类型
 * 
 * @author shenpingfeng 2017年1月5日
 */
@Controller
@RequestMapping(value = "estateType")
public class EstateTypeController {

	public static final Logger LOGGER = LoggerFactory.getLogger(EstateTypeController.class);
	@Autowired
	private EstateTypeManager estateTypeManager;

	/**
	 * 获取所有的物业类型
	 * shenpingfeng
	 * 2017年1月5日
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "list", method = RequestMethod.GET)
	@ResponseBody
	public RestBody<List<EstateType>> list(HttpServletRequest request) {

		Result<List<EstateType>> result = estateTypeManager.getAllEstateType();

		return new RestBody<List<EstateType>>(SkuResultCode.SUCCESS, result.getDataModel());

	}

}
